package com.appcenter.message.mapper;

import com.appcenter.message.model.Messages;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface MessagesMapper {

    @Insert("<script>" +
            "insert into Messages(Id,Title,MsContent,PCUrl,MobileUrl,MessageType,IsSend,SendStartTime,SendEndTime,BusinessType,CreateTime,CreateUserId,CreateUserCode,CreateUserName,FromAppCode,ToAppCode,ToNames)" +
            "values(#{Id},#{Title},#{MsContent},#{PCUrl},#{MobileUrl},#{MessageType},#{IsSend},#{SendStartTime},#{SendEndTime},#{BusinessType},#{CreateTime},#{CreateUserId},#{CreateUserCode},#{CreateUserName},#{FromAppCode},#{ToAppCode},#{ToNames})" +
            "</script>")
    int addMessages(Messages Message);


    @Select("select * from messages where id=#{MessageId}")
    Messages getMessage(String MessageId);

}
